import { useCallback, useMemo } from 'react';
import { flattenRoutes } from '@/router/routes/utils.ts';
import { bizRoutes } from '@/router/routes';

export const useFlattenedRoutes = () => {
  const _flattenRoutes = useCallback(flattenRoutes, [flattenRoutes]);
  return useMemo(() => {
    return _flattenRoutes(bizRoutes);
  }, [_flattenRoutes]);
};
